<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: Circle.php
 * Date: 2017/1/2
 * Time: 21:45
 */

namespace app\api\controller;

use app\api\model\page\note\AddNote as AddNoteModel;
use app\api\model\page\note\ApproveNote;
use app\api\model\page\note\CancelPraise;
use app\api\model\page\note\CancelReplyPraise;
use app\api\model\page\note\ChargeNote;
use app\api\model\page\note\ClearNoteReply;
use app\api\model\page\note\DelNoteReply;
use app\api\model\page\note\GetApproveNoteList;
use app\api\model\page\note\GetMineNoteList;
use app\api\model\page\note\GetMineReplyNoteList;
use app\api\model\page\note\GetNoteInfo as GetNoteInfoModel;
use app\api\model\page\note\GetNoteAnswerList;
use app\api\model\page\note\GetNoteList;
use app\api\model\page\note\GetNoteReplyInfo;
use app\api\model\page\note\GetNoteReplyReplyList;
use app\api\model\page\note\GetRewardList;
use app\api\model\page\note\GetRewardMineList;
use app\api\model\page\note\GetUnreadPraiseList;
use app\api\model\page\note\NoteAnswer;
use app\api\model\page\note\NoteReplyAnswer;
use app\api\model\page\note\Praise as PraiseModel;
use app\api\model\page\note\GetNotePraiseCount as GetNotePraiseCountModel;
use app\api\model\page\note\NoteReward as NoteRewardModel;
use app\api\model\page\note\GetRewardGift as GetRewardGiftModel;
use app\api\model\page\note\ReplyPraise;
use app\api\model\page\note\UpdateNote;
use think\Request;

class Note
{

    private $addNoteModel;
    private $getNoteInfoModel;
    private $notePriaseModel;
    private $notePriaseCountModel;
    private $noteReward;
    private $getRewardGift;
    private $noteReply;
    private $getNoteReply;
    private $getNoteList;
    private $getMineNoteList;
    private $getMineReplyNoteList;

    protected $param;

    public function __construct()
    {
        $this->param = Request::instance()->param();

        $this->addNoteModel = new AddNoteModel();
        $this->getNoteInfoModel = new GetNoteInfoModel();
        $this->notePriaseModel = new PraiseModel();
        $this->notePriaseCountModel = new GetNotePraiseCountModel();
        $this->noteReward = new NoteRewardModel();
        $this->getRewardGift = new GetRewardGiftModel();
        $this->noteReply = new NoteAnswer();
        $this->getNoteReply = new GetNoteAnswerList();
        $this->getNoteList = new GetNoteList();
        $this->getMineNoteList = new GetMineNoteList();
        $this->getMineReplyNoteList = new GetMineReplyNoteList();
    }

    /**
     * 发帖
     *
     * @return array
     */
    public function addNote()
    {
        return $this->addNoteModel->excute($this->param);
    }

    public function updateNote()
    {
        $obj = new UpdateNote();
        return $obj->excute($this->param);
    }

    /**
     * 获取帖子详情
     *
     * @return array
     */
    public function getNoteInfo()
    {
        return $this->getNoteInfoModel->excute($this->param);
    }

    /**
     * 获取帖子列表
     *
     * @return array
     */
    public function getNoteList()
    {
        return $this->getNoteList->excute($this->param);
    }

    /**
     * 获取某用户发出的帖子列表
     *
     * @return array
     */
    public function getUserNoteList()
    {
        return $this->getMineNoteList->excute($this->param);
    }

    /**
     * 获取某用户回复的帖子列表
     *
     * @return array
     */
    public function getUserReplyNoteList()
    {
        return $this->getMineReplyNoteList->excute($this->param);
    }

    /**
     * 帖子赞
     *
     * @return array
     */
    public function praise()
    {
        return $this->notePriaseModel->excute($this->param);
    }

    public function cancelPraise()
    {
        $obj = new CancelPraise();
        return $obj->excute($this->param);
    }

    /**
     * 帖子回复的赞
     *
     * @return array
     */
    public function replyPraise()
    {
        $obj = new ReplyPraise();
        return $obj->excute($this->param);
    }

    public function cancelReplyPraise()
    {
        $obj = new CancelReplyPraise();
        return $obj->excute($this->param);
    }

    /**
     * 获取帖子赞数量
     *
     * @return array
     */
    public function getNotePraiseCount()
    {
        return $this->notePriaseCountModel->excute($this->param);
    }

    /**
     * 获取帖子未读赞列表
     *
     * @return array
     */
    public function getUnreadPraiseList()
    {
        $obj = new GetUnreadPraiseList();
        return $obj->excute($this->param);
    }

    /**
     * 帖子回复
     *
     * @return array
     */
    public function noteReply()
    {
        return $this->noteReply->excute($this->param);
    }

    /**
     * 帖子回复的回复
     *
     * @return array
     */
    public function noteReplyReply()
    {
        $obj = new NoteReplyAnswer();
        return $obj->excute($this->param);
    }

    /**
     * 获取帖子回复
     *
     * @return array
     */
    public function getNoteReply()
    {
        return $this->getNoteReply->excute($this->param);
    }

    /**
     * 获取打赏礼物单
     *
     * @return array
     */
    public function getRewardGift()
    {
        return $this->getRewardGift->excute($this->param);
    }

    /**
     * 打赏
     *
     * @return array
     */
    public function reward()
    {
        return $this->noteReward->excute($this->param);
    }

    /**
     * 打赏列表
     *
     * @return array
     */
    public function rewardList()
    {
        $obj = new GetRewardList();
        return $obj->excute($this->param);
    }

    public function rewardMineList()
    {
        $obj = new GetRewardMineList();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function approveNote()
    {
        $obj = new ApproveNote();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function getApproveNoteList()
    {
        $obj = new GetApproveNoteList();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function getNoteReplyReplyList()
    {
        $obj = new GetNoteReplyReplyList();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function delNoteReply()
    {
        $obj = new DelNoteReply();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function getNoteReplyInfo()
    {
        $obj = new GetNoteReplyInfo();
        return $obj->excute($this->param);
    }

    /**
     * 帖子审核
     *
     * @return array
     */
    public function clearNoteReply()
    {
        $obj = new ClearNoteReply();
        return $obj->excute($this->param);
    }

    /**
     * 帖子举报
     *
     * @return array
     */
    public function chargeNote()
    {
        $obj = new ChargeNote();
        return $obj->excute($this->param);
    }
}
